﻿using MediatR;
using RBAC.Domain;
using RBAC.Domain.Service.Interfae;
using RBACDuYaJun.Api.Appliction.Command.UserCommand;

namespace RBACDuYaJun.Api.Appliction.CommandHandlers.UserHanders
{
    /// <summary>
    /// 所在市
    /// </summary>
    public class CityShowCommandHandler : IRequestHandler<CityShowCommand, List<City>>
    {
        private readonly ICityService _cityService;
        public CityShowCommandHandler(ICityService cityService)
        {
            _cityService = cityService;
        }

        public async Task<List<City>> Handle(CityShowCommand request, CancellationToken cancellationToken)
        {
            return await _cityService.GetCities(request.ProvinceId);
        }
    }
}
